package mviewer.renderer.software.perspective;

import mviewer.renderer.software.interfaces.IPerspective;
import java.awt.Polygon;
import mviewer.types.Camera;
import mviewer.types.IPolygon;
import mviewer.types.IVertex;

public class ParallelPerspective implements IPerspective {

	public Polygon render2dPolygon(IPolygon p, Camera camera,
									int left, int top) {
		IVertex[] v = p.getVertices();
		int[] x = new int[v.length], y = new int[v.length];
		for (int i = 0; i < v.length; i++) {
			x[i] = (int)(v[i].getX() + left);
			y[i] = (int)(v[i].getY() + top);
		}
		return new Polygon(x, y, v.length);
	}
}
